package com.eian.boot.common.id.mapper;

import com.eian.boot.common.id.model.IdFormatConfigEntity;
import com.mybatisflex.core.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * ID格式配置Mapper
 *
 * @author alex.meng
 */
public interface IdFormatConfigMapper extends BaseMapper<IdFormatConfigEntity> {

    /**
     * 根据业务类型查询格式配置
     *
     * @param bizType 业务类型
     * @return 格式配置
     */
    @Select("SELECT biz_type, id_content_type, prefix_template, prefix, suffix_template, suffix, pad_char, id_length, pad_position, use_obfuscate, status, description, created_at, modified_at FROM id_format_config WHERE biz_type = #{bizType} AND status = 1")
    IdFormatConfigEntity selectByBizType(@Param("bizType") String bizType);
}

